package day18.feifei;

public class MyRunnable implements Runnable{
    private String name;

    public MyRunnable(String name) {
        this.name=name;
}

    @Override
    public void run() {
        for(int i=0;i<50;i++){
            System.out.println(this.name+"----"+i);
        }
    }
}
class Main{
    public static void main(String[] args) {
        MyRunnable myRunnable = new MyRunnable("1");
        MyRunnable myRunnable1 = new MyRunnable("2");
        Thread thread = new Thread(myRunnable);
        Thread thread1 = new Thread(myRunnable1);
        thread.start();
        thread1.start();

        for(int i=0;i<50;i++){
            System.out.println(Thread.currentThread().getName()+i);
        }
    }}
